<?
if(!ANTIHACK) die("ANTIHACK...");
include_once(INCLUDES."buildlink.php");
include_once(INCLUDES."paging.php");
$table="gallery_item";

$q=query("select * from gallery_album where id=".intval($_GET["id"]));
$r=fetch($q);
$smarty->assign("album",$r);
$where="parent=".intval($_GET["id"]);
$total=0;$start=0;$limit=30;
$listpage= paging($table,$where,$_GET,$total,$start,$limit,5);
//lay danh sach bai post
$q=query("select * from $table where $where limit $start,$limit");
while($r=fetch($q))
{
	$data[]=$r;
}
$smarty->assign("total",$total);
$smarty->assign("listpage",$listpage);
$smarty->assign("curpage",$_GET["page"]);
$smarty->assign("data",$data);
$smarty->display("viewalbum.htm");
?>